<ng-container [formGroup]="controlContainer.control">
  <div>
    <div>已选人员情况：</div>
    <div>
      <span *ngIf="form.value.user.all; else userCountRef">
        已选择区内全部人员
      </span>
      <ng-template #userCountRef>
        <span>管理员人数：{{ admin_count }}</span>
        <span>普通成员人数：{{ user_count }}</span>
      </ng-template>
      <button class="btn btn-secondary btn-sm" (click)="preview(userPreviewRef)">预览</button>
    </div>
  </div>

  <div>
    <div>已选终端情况：</div>
    <div>
      <span *ngIf="form.value.pc.all; else pcCountRef">
        已选择区内全部终端
      </span>
      <ng-template #pcCountRef>
        <span>终端数量：{{ pc_count }}</span>
      </ng-template>
      <button class="btn btn-secondary btn-sm" (click)="preview(pcPreviewRef)">预览</button>
    </div>
    <div>终端登录权限：{{ pc_auth ? '开启' : '关闭' }}</div>
  </div>

  <div>
    <div>
      <span>配置屏幕保护</span>
      <button class="btn btn-secondary btn-sm" (click)="reset('screensaver')">恢复默认</button>
    </div>
    <div>
      <m-screensaver formGroupName="screensaver"></m-screensaver>
    </div>
  </div>

  <div>
    <div>
      <span>配置熄屏时间</span>
      <button class="btn btn-secondary btn-sm" (click)="reset('power')">恢复默认</button>
    </div>
    <div>
      <div class="_align-center">关闭屏幕：</div>
      <m-display-standby formGroupName="power"></m-display-standby>
    </div>
  </div>

  <div formGroupName="wallpaper">
    <div>
      <div>配置桌面壁纸：</div>
      <button class="btn btn-sm btn-secondary" (click)="reset('wallpaper')">恢复默认</button>
    </div>
    <div>
      <div class="group">
        <div>壁纸设定：</div>
        <div>
          <m-image-preview class="wallpaper" [control]="wallpaperRef" formControlName="image">
            <input type="file" accept="image/*" #wallpaperRef />
          </m-image-preview>
        </div>
      </div>
    </div>
  </div>

  <div>
    <div>
      <div>配置额外脚本：</div>
      <button class="btn btn-sm btn-secondary" (click)="reset('script')">恢复默认</button>
    </div>
    <div>
      <div class="group">
        <m-script-input formGroupName="script" [nameSuffixNot]="['py', 'sh']"></m-script-input>
      </div>
    </div>
  </div>
</ng-container>

<ng-template #userPreviewRef>
  <div class="m-3">
    <m-select-personnel [preview]="user_preview"></m-select-personnel>
  </div>
</ng-template>

<ng-template #pcPreviewRef>
  <div class="m-3">
    <m-select-computer [preview]="pc_preview"></m-select-computer>
  </div>
</ng-template>
